/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * MyInternalFrame.java
 *
 * Created on Jun 16, 2009, 10:51:05 PM
 */

package GUI;

/**
 *
 * @author trquanglong
 */
public class MyInternalFrame extends javax.swing.JInternalFrame {

    /** Creates new form MyInternalFrame */
    public MyInternalFrame() {
        initComponents();
    }

    public MyInternalFrame(String name, String organization, String mobile, String homePhone, String workPhone, String email, String additionalEmail) {
        initComponents();
        txtName.setText(name);
        if (organization.equals(""))
            txtOrganization.setText("    <Company>");
        else
            txtOrganization.setText(organization);

        if (mobile.equals(""))
            txtMobile.setText("    <Mobile>");
        else
            txtMobile.setText(mobile);

        if (homePhone.equals(""))
            txtHomePhone.setText("    <Home Phone>");
        else
            txtHomePhone.setText(homePhone);

        if (workPhone.equals(""))
            txtWorkPhone.setText("    <Work Phone>");
        else
            txtWorkPhone.setText(workPhone);

        if (email.equals(""))
            txtEmail.setText("    <Email>");
        else
            txtEmail.setText(email);

        if (additionalEmail.equals(""))
            txtAdditionalEmail.setText("    <Additional Email>");
        else
            txtAdditionalEmail.setText(additionalEmail);

        this.setTitle(name);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel2 = new javax.swing.JPanel();
        txtName = new javax.swing.JLabel();
        txtOrganization = new javax.swing.JLabel();
        txtMobile = new javax.swing.JLabel();
        txtHomePhone = new javax.swing.JLabel();
        txtWorkPhone = new javax.swing.JLabel();
        txtEmail = new javax.swing.JLabel();
        txtAdditionalEmail = new javax.swing.JLabel();
        jPanel1 = new javax.swing.JPanel();

        setBorder(javax.swing.BorderFactory.createTitledBorder(""));
        setFrameIcon(new javax.swing.ImageIcon(getClass().getResource("/GUI/business_card_icon_small.png"))); // NOI18N

        txtName.setFont(new java.awt.Font("Tahoma", 1, 18));
        txtName.setForeground(new java.awt.Color(133, 19, 19));
        txtName.setText("jLabel1");

        txtOrganization.setFont(new java.awt.Font("Tahoma", 0, 18));
        txtOrganization.setText("jLabel1");

        txtMobile.setFont(new java.awt.Font("Tahoma", 0, 18));
        txtMobile.setText("jLabel1");

        txtHomePhone.setFont(new java.awt.Font("Tahoma", 0, 18));
        txtHomePhone.setText("jLabel1");

        txtWorkPhone.setFont(new java.awt.Font("Tahoma", 0, 18));
        txtWorkPhone.setText("jLabel1");

        txtEmail.setFont(new java.awt.Font("Tahoma", 0, 18));
        txtEmail.setText("jLabel1");

        txtAdditionalEmail.setFont(new java.awt.Font("Tahoma", 0, 18));
        txtAdditionalEmail.setText("jLabel1");

        jPanel1.setBackground(new java.awt.Color(220, 232, 227));

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 47, Short.MAX_VALUE)
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 231, Short.MAX_VALUE)
        );

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(txtAdditionalEmail)
                        .addContainerGap())
                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanel2Layout.createSequentialGroup()
                            .addComponent(txtOrganization, javax.swing.GroupLayout.DEFAULT_SIZE, 250, Short.MAX_VALUE)
                            .addContainerGap())
                        .addComponent(txtName, javax.swing.GroupLayout.DEFAULT_SIZE, 260, Short.MAX_VALUE)
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                            .addComponent(txtMobile, javax.swing.GroupLayout.DEFAULT_SIZE, 250, Short.MAX_VALUE)
                            .addContainerGap())
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                            .addComponent(txtHomePhone, javax.swing.GroupLayout.DEFAULT_SIZE, 250, Short.MAX_VALUE)
                            .addContainerGap())
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                            .addComponent(txtWorkPhone, javax.swing.GroupLayout.DEFAULT_SIZE, 250, Short.MAX_VALUE)
                            .addContainerGap())
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                            .addComponent(txtEmail, javax.swing.GroupLayout.DEFAULT_SIZE, 250, Short.MAX_VALUE)
                            .addContainerGap()))))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addComponent(txtName)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(txtOrganization)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(txtMobile)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(txtHomePhone)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(txtWorkPhone)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(txtEmail)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(txtAdditionalEmail)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        getContentPane().add(jPanel2, java.awt.BorderLayout.CENTER);

        pack();
    }// </editor-fold>//GEN-END:initComponents


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JLabel txtAdditionalEmail;
    private javax.swing.JLabel txtEmail;
    private javax.swing.JLabel txtHomePhone;
    private javax.swing.JLabel txtMobile;
    private javax.swing.JLabel txtName;
    private javax.swing.JLabel txtOrganization;
    private javax.swing.JLabel txtWorkPhone;
    // End of variables declaration//GEN-END:variables

}
